<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@include file="/resource/common/taglib.jspf"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>${SESSION_COMPANY}-权限管理</title>
<%@include file="/resource/common/jquery.jspf"%>
<%@include file="/resource/common/commonCss.jspf"%>
<%@include file="/resource/common/bootstrap.jspf"%>
<%@include file="/resource/common/showLoading.jspf"%>
<%@include file="/resource/common/tips.jspf"%>
<script type="text/javascript" src="${ctx }/resource/js/system/roleauthority.js"></script>


<style type="text/css">
<!--
#role-authority-box {
	width: auto;
	height: auto;
	overflow: hidden;
	padding: 0;
}

#role-authority-left-box {
	float: left;
	width: auto;
	min-width: 160px;
    height:auto;
	min-height: 520px;
	overflow: hidden;
	margin-right: 10px;
	padding: 10px;
	border-right: 1px solid #e2e2e2;
}

#role-authority-right-box {
	float: left;
	width: 80%;
	overflow: hidden;
	height: auto;
	padding: 0;
}

#role-authority-right-box #moduleList {
	padding: 10px 0 10px 0;
}

#moduleSave {
	width: auto;
	height: auto;
	overflow: hidden;
	padding: 10px 0 10px 0;
	display: none;
	clear: both;
}

dl {
	font-family: "Microsoft YaHei";
	display: block;
	padding: 0;
	line-height: 24px;
	clear: both;
}

dl dt {
	float: left;
	background-color: #0095cd;
	color: #FFF;
	padding: 0 10px 0 10px;
	margin-right: 15px;
	margin-top: 10px;
	width:150px;
}

dl dd {
	float: left;
	word-break: keep-all;
	overflow: hidden;
	padding: 0px;
	width: 9%;
}

dl dd label {
	display: inline-block;
	font-weight: normal;
}

select {
	border-radius: 4px;
	border: 1px solid #ccc;
	font-family: inherit;
	font-size: 12px;
	height: 26px;
	line-height: 26px;
}

.selected {
	font-weight: bold;
	color: #57a000;
	background-color: #888;
}

.label_on {
	border: 2px solid red;
}

#role-authority-left-box li {
	cursor:pointer;
	list-style-type:none;
	list-style:none;
}
-->
</style>
<script type="text/javascript">
	var PATH = "${ctx}";
	
	$(function(){
		//全部选择
		$("#all").click(function(){  
			$("#moduleList input[type='checkbox']").each(function(){
			   $(this).prop("checked",true);
			}); 
		});
		//取消选择
		$("#delAll").click(function(){  
			$("#moduleList input[type='checkbox']").each(function(){
				$(this).prop("checked",false);
			});  
		});
	
		//反向选择
		$("#antiAll").click(function(){
			$("#moduleList input[type='checkbox']").each(function(){
				$(this).prop("checked",!this.checked);              
			});
		});
	});
</script>
</head>
<body>
	<div id="body-wrapper">
		<div id="main-content2">
			<div class="clear"></div>
			<div class="content-box">
				<div class="content-box-header">
					<ul class="content-box-tabs">
					</ul>
					<div class="clear"></div>
				</div>
				<div class="content-box-content">
					<div class="tab-content default-tab" id="tab1">
						<div id="role-authority-box">
							<div id="role-authority-left-box"></div>
							<div id="role-authority-right-box">
								<form class="form-inline" >
									<div class="form-group">
								    <div class="input-group">
								      <div class="input-group-addon">选择主模块</div>
								     	 <select name="moduletype" id="moduletype" onchange="initModuleType(this.value);" class="form-control">
											
										</select>
								    </div>
							  		</div>
									<input type="hidden" id="rid" name="rid"/> 
									<input type="hidden" id="mid" name="mid" />
									<div class="form-group">
										<button type="button" class="btn btn-sm btn-primary"  style="cursor: pointer" id="all" ><i class="fa  fa-check-square-o"></i> 全部选择</button>
									 	<button type="button" class="btn btn-sm btn-warning" style="cursor: pointer" id="delAll" ><i class="fa fa-square-o"></i> 取消选择</button>
										<button type="button" class="btn btn-sm btn-success" style="cursor: pointer" id="antiAll" ><i class="fa fa-check-square"></i> 反向选择</button>
									</div>
								</form>
								<div id="moduleList" style="width: 100%;margin-top: 5px;"></div>
								<hr>
								<div id="moduleSave">
									<shiro:hasPermission name="SysRoleAuthority:SYS_GRANT">
										<button id="save" name="save" type="button" class="btn btn-primary" onclick="Save();" style="width: 87%; height: 50px;cursor: pointer" >保存</button>
									</shiro:hasPermission>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>
